home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / ATT.ZIP / ADVSETTI.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1995-04-08  |  10.8 KB  |  335 lines

  1. VERSION 2.00
  2. Begin Form AdvSettings 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Advanced Settings"
  6.    ClientHeight    =   1770
  7.    ClientLeft      =   1290
  8.    ClientTop       =   1590
  9.    ClientWidth     =   6015
  10.    ControlBox      =   0   'False
  11.    Height          =   2205
  12.    Left            =   1215
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   1770
  17.    ScaleWidth      =   6015
  18.    Top             =   1230
  19.    Width           =   6165
  20.    Begin CommandButton Command3 
  21.       Cancel          =   -1  'True
  22.       Caption         =   "Cancel"
  23.       Height          =   330
  24.       Left            =   2985
  25.       TabIndex        =   6
  26.       Top             =   1245
  27.       Width           =   1215
  28.    End
  29.    Begin CommandButton Command1 
  30.       Caption         =   "OK"
  31.       Default         =   -1  'True
  32.       Height          =   330
  33.       Left            =   1650
  34.       TabIndex        =   5
  35.       Top             =   1245
  36.       Width           =   1215
  37.    End
  38.    Begin PictureBox U 
  39.       AutoSize        =   -1  'True
  40.       Height          =   360
  41.       Left            =   4080
  42.       Picture         =   ADVSETTI.FRX:0000
  43.       ScaleHeight     =   330
  44.       ScaleWidth      =   135
  45.       TabIndex        =   12
  46.       TabStop         =   0   'False
  47.       Top             =   3660
  48.       Visible         =   0   'False
  49.       Width           =   165
  50.    End
  51.    Begin PictureBox D 
  52.       AutoSize        =   -1  'True
  53.       Height          =   360
  54.       Left            =   3900
  55.       Picture         =   ADVSETTI.FRX:012A
  56.       ScaleHeight     =   330
  57.       ScaleWidth      =   135
  58.       TabIndex        =   11
  59.       TabStop         =   0   'False
  60.       Top             =   3660
  61.       Visible         =   0   'False
  62.       Width           =   165
  63.    End
  64.    Begin PictureBox N 
  65.       AutoSize        =   -1  'True
  66.       Height          =   360
  67.       Left            =   4260
  68.       Picture         =   ADVSETTI.FRX:0254
  69.       ScaleHeight     =   330
  70.       ScaleWidth      =   135
  71.       TabIndex        =   10
  72.       TabStop         =   0   'False
  73.       Top             =   3660
  74.       Visible         =   0   'False
  75.       Width           =   165
  76.    End
  77.    Begin PictureBox SpinButton 
  78.       AutoSize        =   -1  'True
  79.       BackColor       =   &H00C0C0C0&
  80.       Height          =   360
  81.       Index           =   0
  82.       Left            =   2835
  83.       ScaleHeight     =   330
  84.       ScaleWidth      =   135
  85.       TabIndex        =   9
  86.       TabStop         =   0   'False
  87.       Top             =   255
  88.       Width           =   165
  89.    End
  90.    Begin SSFrame Frame3D1 
  91.       ForeColor       =   &H00000000&
  92.       Height          =   420
  93.       Index           =   0
  94.       Left            =   2430
  95.       TabIndex        =   8
  96.       Top             =   180
  97.       Width           =   345
  98.       Begin TextBox tDelay 
  99.          Alignment       =   1  'Right Justify
  100.          BackColor       =   &H00C0C0C0&
  101.          BorderStyle     =   0  'None
  102.          Height          =   216
  103.          Left            =   36
  104.          MaxLength       =   2
  105.          MultiLine       =   -1  'True
  106.          TabIndex        =   2
  107.          Tag             =   "h"
  108.          Text            =   "99"
  109.          Top             =   150
  110.          Width           =   276
  111.       End
  112.    End
  113.    Begin SSFrame Frame3D1 
  114.       ForeColor       =   &H00000000&
  115.       Height          =   420
  116.       Index           =   2
  117.       Left            =   2430
  118.       TabIndex        =   7
  119.       Top             =   630
  120.       Width           =   345
  121.       Begin TextBox tGiveaway 
  122.          Alignment       =   1  'Right Justify
  123.          BackColor       =   &H00C0C0C0&
  124.          BorderStyle     =   0  'None
  125.          Height          =   210
  126.          Left            =   30
  127.          MaxLength       =   2
  128.          MultiLine       =   -1  'True
  129.          TabIndex        =   4
  130.          Tag             =   "h"
  131.          Text            =   "99"
  132.          Top             =   150
  133.          Width           =   270
  134.       End
  135.    End
  136.    Begin PictureBox SpinButton2 
  137.       AutoSize        =   -1  'True
  138.       BackColor       =   &H00C0C0C0&
  139.       Height          =   360
  140.       Index           =   0
  141.       Left            =   2835
  142.       ScaleHeight     =   330
  143.       ScaleWidth      =   135
  144.       TabIndex        =   0
  145.       TabStop         =   0   'False
  146.       Top             =   705
  147.       Width           =   165
  148.    End
  149.    Begin Label Label2 
  150.       BackColor       =   &H00C0C0C0&
  151.       BackStyle       =   0  'Transparent
  152.       Caption         =   "times before next update check"
  153.       Height          =   240
  154.       Index           =   3
  155.       Left            =   3045
  156.       TabIndex        =   14
  157.       Top             =   780
  158.       Width           =   2775
  159.    End
  160.    Begin Label Label2 
  161.       BackColor       =   &H00C0C0C0&
  162.       BackStyle       =   0  'Transparent
  163.       Caption         =   "seconds"
  164.       Height          =   240
  165.       Index           =   0
  166.       Left            =   3045
  167.       TabIndex        =   13
  168.       Top             =   330
  169.       Width           =   1500
  170.    End
  171.    Begin Label Label2 
  172.       Alignment       =   1  'Right Justify
  173.       BackColor       =   &H00C0C0C0&
  174.       BackStyle       =   0  'Transparent
  175.       Caption         =   "Update display every"
  176.       Height          =   240
  177.       Index           =   1
  178.       Left            =   105
  179.       TabIndex        =   1
  180.       Top             =   330
  181.       Width           =   2280
  182.    End
  183.    Begin Label Label2 
  184.       Alignment       =   1  'Right Justify
  185.       BackColor       =   &H00C0C0C0&
  186.       BackStyle       =   0  'Transparent
  187.       Caption         =   "Give control to Windows"
  188.       Height          =   240
  189.       Index           =   2
  190.       Left            =   0
  191.       TabIndex        =   3
  192.       Top             =   780
  193.       Width           =   2370
  194.    End
  195. Option Explicit
  196. Declare Function GetTickCount Lib "User" () As Long
  197. Declare Function GetAsyncKeyState Lib "User" (ByVal vKey As Integer) As Integer
  198. Dim LastY As Single
  199. Dim LastDirection As String
  200. Dim tVal As Integer
  201. Sub Command1_Click ()
  202. gtDelay = tDelay.Text
  203. gtGiveaway = tGiveaway.Text
  204. Unload Me
  205. End Sub
  206. Sub Command3_Click ()
  207.    gtGiveaway = SavedtGiveaway
  208.    gtDelay = SavedtDelay
  209.    Unload Me
  210. End Sub
  211. Sub Form_Load ()
  212. Dim InitialHeight As Integer
  213.     InitialHeight = SpinButton(0).Height
  214.     SpinButton(0).Picture = N.Picture       'Set to the Normal Spin Button
  215.     SpinButton(0).Top = SpinButton(0).Top + (InitialHeight - SpinButton(0).Height) / 2
  216.     SpinButton2(0).Picture = N.Picture       'Set to the Normal Spin Button
  217.     SpinButton2(0).Top = SpinButton2(0).Top + (InitialHeight - SpinButton2(0).Height) / 2
  218.    AdvSettings.Left = Screen.Width / 2 - (AdvSettings.Width / 2)
  219.    AdvSettings.Top = Screen.Height / 2 - (AdvSettings.Height / 2)
  220.    tGiveaway.Text = gtGiveaway
  221.    tDelay.Text = gtDelay
  222. End Sub
  223. Sub MoveDown (c As Control)
  224. Dim CurVal As Integer
  225. CurVal% = Val(c.Text) - 1
  226. If CurVal% > 0 Then c.Text = CurVal%
  227. End Sub
  228. Sub MoveUp (c As Control)
  229. Dim CurVal As Integer
  230. CurVal% = Val(c.Text) + 1
  231. If CurVal% < 100 Then c.Text = CurVal%
  232. End Sub
  233. Sub SpinButton_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  234. Const VK_LBUTTON = &H1
  235. Const TIME_DELAY = 180      ' Time delay between Spin Button Events
  236. Dim dwEvent As Long
  237. LastY = Y
  238. ' Make sure that the Spin Button Event occurs at least once
  239. dwEvent = GetTickCount() - TIME_DELAY
  240. SpinIt:
  241.    ' Do this while the user holds down the left mouse button
  242.    Do While (GetAsyncKeyState(VK_LBUTTON) And &H8000) = -32768
  243.         ' Break out of the loop if we haven't waited long enough
  244.         If dwEvent + TIME_DELAY > GetTickCount() Then GoTo Break:
  245.         ' If the user wants to increment the counter
  246.         If Y > (SpinButton(Index).Height \ 2) Then
  247.             SpinButton(Index).Picture = d.Picture  ' Set Picture to Up
  248.             Call MoveDown(tDelay)
  249.             LastDirection$ = "d"
  250.         End If
  251.         ' If the user wants to decrement the counter
  252.         If Y < (SpinButton(Index).Height \ 2) Then
  253.             SpinButton(Index).Picture = u.Picture   ' Set Picture to Down
  254.             Call MoveUp(tDelay)
  255.             LastDirection$ = "u"
  256.         End If
  257.         ' Save the last time the Spin Button was active
  258.         dwEvent = GetTickCount()
  259.     Loop
  260.     ' Set the Picture to Normal
  261.     SpinButton(Index).Picture = N.Picture
  262.     tDelay.SetFocus
  263.     DoEvents
  264.     Exit Sub
  265. Break:
  266.     GoTo SpinIt:
  267. End Sub
  268. Sub SpinButton2_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  269. Const VK_LBUTTON = &H1
  270. Const TIME_DELAY = 180      ' Time delay between Spin Button Events
  271. Dim dwEvent As Long
  272. LastY = Y
  273. ' Make sure that the Spin Button Event occurs at least once
  274. dwEvent = GetTickCount() - TIME_DELAY
  275. SpinIt2:
  276.    ' Do this while the user holds down the left mouse button
  277.    Do While (GetAsyncKeyState(VK_LBUTTON) And &H8000) = -32768
  278.         ' Break out of the loop if we haven't waited long enough
  279.         If dwEvent + TIME_DELAY > GetTickCount() Then GoTo Break2:
  280.         ' If the user wants to increment the counter
  281.         If Y > (SpinButton2(Index).Height \ 2) Then
  282.             SpinButton2(Index).Picture = d.Picture  ' Set Picture to Up
  283.             Call MoveDown(tGiveaway)
  284.             LastDirection$ = "d"
  285.         End If
  286.         ' If the user wants to decrement the counter
  287.         If Y < (SpinButton2(Index).Height \ 2) Then
  288.             SpinButton2(Index).Picture = u.Picture   ' Set Picture to Down
  289.             Call MoveUp(tGiveaway)
  290.             LastDirection$ = "u"
  291.         End If
  292.         ' Save the last time the Spin Button was active
  293.         dwEvent = GetTickCount()
  294.     Loop
  295.     ' Set the Picture to Normal
  296.     SpinButton2(Index).Picture = N.Picture
  297.     tGiveaway.SetFocus
  298.     DoEvents
  299.     Exit Sub
  300. Break2:
  301.     GoTo SpinIt2:
  302. End Sub
  303. Sub tDelay_GotFocus ()
  304. tDelay.SelStart = 0
  305. tDelay.SelLength = 2
  306. End Sub
  307. Sub tDelay_KeyPress (KeyAscii As Integer)
  308. If KeyAscii >= 32 Then
  309.    If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then KeyAscii = 0
  310. End If
  311. End Sub
  312. Sub tDelay_LostFocus ()
  313. tVal = Val(tDelay.Text)
  314. If tVal < 1 Or tVal > 99 Then
  315.    tVal = 99
  316. End If
  317. tDelay.Text = Format$(tVal, "0")
  318. End Sub
  319. Sub tGiveaway_GotFocus ()
  320. tGiveaway.SelStart = 0
  321. tGiveaway.SelLength = 2
  322. End Sub
  323. Sub tGiveaway_KeyPress (KeyAscii As Integer)
  324. If KeyAscii >= 32 Then
  325.    If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then KeyAscii = 0
  326. End If
  327. End Sub
  328. Sub tGiveaway_LostFocus ()
  329. tVal = Val(tGiveaway.Text)
  330. If tVal < 1 Or tVal > 99 Then
  331.    tVal = 99
  332. End If
  333. tGiveaway.Text = Format$(tVal, "0")
  334. End Sub
  335.